﻿using System.Runtime.Serialization;

namespace GoogleAPI.UrlShortener
{
    /// <summary>
    /// Reference Guide at
    /// http://code.google.com/apis/urlshortener/v1/reference.html
    /// 
    /// A URL Resource encapsulates a short URL/long URL pair, as well as some constant and variable properties of the URLs:
    ///
    /// •Status string for the long URL, such as "OK" or "MALWARE".
    /// •Creation timestamp specifying when the short URL was created.
    /// •Click analytics information.
    ///
    /// The specific set of properties returned depends on the method called.
    /// </summary>
    [DataContract]
    public class ExpandResponse
    {
        /// <summary>
        /// The fixed string "urlshortener#url".
        /// </summary>
        [DataMember(Name="kind")]
        public string Kind { get; set; }

        /// <summary>
        /// Short URL, e.g. "http://goo.gl/l6MS".
        /// </summary>
        [DataMember(Name = "id")]
        public string Id { get; set; }

        /// <summary>
        /// Long URL, e.g. "http://www.google.com/". Might not be present if the status is "REMOVED".
        /// </summary>
        [DataMember(Name = "longUrl")]
        public string LongUrl { get; set; }

        /// <summary>
        /// Status of the target URL. Possible values: "OK", "MALWARE", "PHISHING", or "REMOVED". 
        /// A URL might be marked "REMOVED" if it was flagged as spam, for example.
        /// </summary>
        [DataMember(Name = "status")]
        public string Status { get; set; }

        /// <summary>
        /// Time the short URL was created; ISO 8601 representation using the yyyy-MM-dd'T'HH:mm:ss.SSSZZ format, 
        /// e.g. "2010-10-14T19:01:24.944+00:00".
        /// </summary>
        [DataMember(Name = "created")]
        public string Created { get; set; }

        /// <summary>
        /// A summary of the click analytics for the short and long URL. 
        /// Might not be present if not requested or currently unavailable.
        /// </summary>
        [DataMember(Name = "analytics")]
        public Analytics Analytics { get; set; }
    }
}
